﻿@model List<UcAsp.Models.Comments>
@{
 
    Layout = "";
}

<style>
  

#facebox .b {
  background:url(/Content/resources/images/b.png);
}

#facebox .tl {
  background:url(/Content/resources/images/tl.png);
}

#facebox .tr {
  background:url(/Content/resources/images/tr.png);
}

#facebox .bl {
  background:url(/Content/resources/images/bl.png);
}

#facebox .br {
  background:url(/Content/resources/images/br.png);
}

#facebox {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 100;
  text-align: left;
}

    #facebox .popup
    {
        position: relative;
        border: 3px solid rgba(0,0,0,0);
        -webkit-border-radius: 5px;
        -moz-border-radius: 5px;
        border-radius: 5px;
        -webkit-box-shadow: 0 0 18px rgba(0,0,0,0.4);
        -moz-box-shadow: 0 0 18px rgba(0,0,0,0.4);
    }

#facebox table {
  border-collapse: collapse;
}

#facebox td {
  border-bottom: 0;
  padding: 0;
}

#facebox .body {
  padding: 10px;
  background: #fff;
  width: 370px;
}

#facebox .loading {
  text-align: center;
}

#facebox .image {
  text-align: center;
}

#facebox img {
  border: 0;
  margin: 0;
}

#facebox ._footer {
  border-top: 1px solid #DDDDDD;
  padding-top: 5px;
  margin-top: 10px;
  text-align: right;
}

#facebox .tl, #facebox .tr, #facebox .bl, #facebox .br {
  height: 10px;
  width: 10px;
  overflow: hidden;
  padding: 0;
}

#facebox_overlay {
  position: fixed;
  top: 0px;
  left: 0px;
  height:100%;
  width:100%;
}

.facebox_hide {
  z-index:-100;
}

.facebox_overlayBG {
  background-color: #000;
  z-index: 99;
}

    .ucaspfacebox
    {
        width:500px;
    }


</style>
<script type="text/javascript" src="/content/resources/scripts/facebox.js"></script>
<script type="text/javascript" src="/Scripts/tinymce/tinymce.min.js"></script>
<script>
     $(function () {
         $("#SaveMessage").click(function () {
             $.post("/User/SaveComments", { ID: $("input[name='ArtID']").val(), Title: $("input[name='Title']").val(), PublichContent: $("#Message").val() }, function (data) {
                 location.reload();
             })
         });
         $(".replay").click(function () {
             $.get("/InfoManager/ReplyComment?ID=" + $(this).attr("data-id"), function (dataresult) {
                
                 $.facebox(dataresult);
             })
         });
         $(".deletereplay").click(
            function () {

            $.post("/InfoManager/DelComments", { ID: $(this).attr("data-id") }, function (dataResult) {
            });
            $(this).fadeTo(400, 0, function () { // Links with the class "close" will close parent
                $(this).slideUp(400);
                $(this).parent().slideUp(400);

            });
            return false;
        }
        );
     })
 </script>

<div class="border course_content" style="margin-bottom:50px; text-align:left;">
    <div class="course_tuij" style="width:976px; float:left;"><span>我要提问</span>
        <input name="ArtID" type="hidden" value="@ViewData["ID"]" />
        <input name="Title" type="hidden" value="@ViewData["Title"]" />
    </div>
   
    <div style="float:left; margin-left:40px;">
        <textarea id="Message" cols="20" rows="2"  class="border" style=" width:600px; height:200px;">

        </textarea>

    </div>
    <div class="clear"></div>
    <div class="course_content" style="text-align:center">
     <input id="SaveMessage" type="button" value="     " style="width:134px; height:42px; background-image:url(/content/image/button.png)" /> 

    </div>

<div>
    @foreach (UcAsp.Models.Comments c in Model)
    {
       <div style="width:976px; margin-top:20px; margin-bottom:20px;">
           <div><img src=" @c.UserInfo.Logo" align="left"  style="margin:10px; width:60px;"  /> @c.UserInfo.UserName   @c.PublichContent @c.PublicDate
          @if (ViewData["Login"]=="Admin")
          {
           <div style="width:976px; text-align:right; color:#808080" class="replay" data-id="@c.ID">回复</div>
          }
           </div>

               @if (@c.Replay!=null)
                    {
                        <div style="width:976px;margin-top:20px; margin-left:80px; margin-bottom:20px;">
                        <img src="@c.Replay.UserInfo.Logo" align="left" style="margin:10px; width:60px;" /> @c.Replay.UserInfo.UserName <font style="color:red;"><b>回复</b></font>
                        @(new HtmlString(@c.Replay.PublichContent))
                            @if (ViewData["Login"]=="Admin")
                            {
                            <div style="width:976px; text-align:right; color:#808080" class="deletereplay" data-id="@c.Replay.ID">删除</div>
                            }
                         </div>
                     }
        </div>
        <div class="clear"></div>
        
         <div class="poitline"></div>
    }
</div>
    <br /> <br /> <br />
    <br /> <br /> <br />
</div>
